/* 
 * FlowPlayer Server Control for ASP.NET 2.0
 * Copyright (C) 2008 Gaiaware AS
 * All rights reserved.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as 
 * published by the Free Software Foundation.
 * 
 * Or if you have purchased the "Professional Edition" from Gaiaware
 * it is distributed to you in person under the Gaia Commercial License
 * which makes it possible for you to create closed source applications
 * and still be able to distribute those applications without creating 
 * restrictions for your source code.
 * 
 * Unless you're developing GPL software you should and probably legally
 * have to purchase a license of the Gaia Commercial License since otherwise
 * you might be forced to GPL license your derived works.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should find a copy of both the GPL version 3 and the 
 * Gaia Commercial License on disc where you have extracted these files.
 * If not visit http://www.gnu.org for the GPL version or 
 * http://gaiaware.net for the Gaia Commercial License.
 * 
 * Breaking the terms of whatever license you're entitled to use will cause
 * prosecution by Gaiaware AS. If possible we will demand to settle any 
 * law suits at a court in Norway.
 * 
 */

using System;
using NetServ.Net.Json;

namespace Gaia.Ajax.UI.WebControls.VideoPlayers
{
    /// <summary>
    /// Each CuePoint Represents a marker in the video. 
    /// </summary>
    public class CuePoint
    {
        /// <summary>
        /// CuePoint Name
        /// </summary>
        public string Name { get; set; }
        
        /// <summary>
        /// TimeSpan when the CuePoint is triggered
        /// </summary>
        public TimeSpan Time { get; set; }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="name">Name</param>
        /// <param name="time">Time</param>
        public CuePoint(string name, TimeSpan time)
        {
            Name = name;
            Time = time;
        }

        internal JsonObject ToJSON()
        {
            return new JsonObject{{"name", Name}, {"time", Time.TotalSeconds}};
        }
    }
}